import type { User, UserRole } from './index';

export const userArr: User[] = [
    {
        id: 1,
        userName: 'admin',
        nickName: 'admin',
        password: '123',
        role: '超级管理员',
        creatDate: '2023-10-01 12:00:00',
        updateDate: '2023-10-01 12:00:00'
    },
    {
        id: 2,
        userName: 'liyan',
        nickName: 'lhongl',
        password: '12334',
        role: '员工',
        creatDate: '2023-10-02 12:00:00',
        updateDate: '2023-10-02 12:00:00'
    }
]

//["超级管理员",'前台'，‘运营’，‘产品’，‘前端’，‘后端’，‘测试’，‘财务’，‘运维’，‘销售’，‘程序鼓励师’]

export const userRoleArr = () => {
    let arr = ["超级管理员", "前台", "运营", "产品", "前端", "后端", "测试", "财务", "运维", "销售", "程序鼓励师"];
    let result: UserRole[] = [];
    for (let index = 0; index < arr.length; index++) {
        result.push({
            id: index + 1,
            createTime: '2023-10-01 12:00:00',
            uodateTime: '2023-10-01 12:00:00',
            roleName: arr[index],
            remark: ''
        } as UserRole);
    }
    let user: UserRole[] = [result[0], result[4]];
    return {
        allRole: result,
        user: user
    };
}